package com.kevms.phonewars;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

/** 
* @class Authenticate
* 
* @brief Activity used to authenticate the user
* 
* This activity uses a browser intent. In the browser the pw_authenticate.php page
* will be loaded and the user will verify themselves using OpenID.
*/ 
public class Authenticate extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.authenticate);
		
		Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://pba.cs.clemson.edu/~kevin4/pw/pw_authenticate.php"));
		browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		startActivityForResult(browserIntent, 0);
	}
	
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		finish();
    }
}
